
<!--添加弹出框-->
<div class="wizard" id="wizard-demo">
    <form id="addForm" method="post">
        <h1>添加菜单</h1>
        <div class="wizard-card" data-onValidated="setServerName" data-cardname="name">
            <h3 class="text-center"><span>添加菜单</span></h3>

            <div class="form-group">
                <label class="control-label col-sm-3 col-md-3 col-xs-3">上级菜单<span>*</span></label>
                <select class="form-control col-sm-9 col-md-9 col-xs-9" name="pid_add">
                    <option value="0" selected>一级菜单</option>
                    {volist name="ways" id="v"}
                    {if condition="$v['pid'] eq '0'"}
                    <option value="{$v['wid']}">{$v.w_name}</option>
                    {/if}
                    {/volist}
                </select>
            </div>

            <!--<div class="wizard-input-section">-->
                <div class="form-group">
                    <label for="last-name" class="control-label col-sm-3 col-md-3 col-xs-3">菜单名称 <span>*</span>
                    </label>
                    <input type="text" id="last-name" name="w_name_add" required="required" class="form-control col-md-9 col-xs-9">
                </div>
            <!--</div>-->
            <!--<div class="wizard-input-section">-->
                <div class="form-group">
                    <label class="control-label col-sm-3 col-md-3 col-xs-3" for="last-name">控制器名 <span>*</span>
                    </label>
                    <input type="text" name="w_control_add" required="required" class="form-control col-md-9 col-xs-9">

                </div>
            <!--</div>-->
            <!--<div class="wizard-input-section">-->
                <div class="form-group">
                    <label class="control-label col-sm-3 col-md-3 col-xs-3" for="last-name">操作名 <span class="required">*</span>
                    </label>
                    <input type="text" name="w_way_add" required="required" class="form-control col-md-9 col-xs-9">
                </div>
            <!--</div>-->
            <!--<div class="wizard-input-section">-->
                <div class="form-group">
                    <label for="middle-name" class="control-label col-sm-3 col-md-3 col-xs-3">状态 </label>
                    <select id="middle-name" class="form-control col-md-9 col-xs-9" name="status_add">
                        <option value="1" selected>正常</option>
                        <option value="0">禁用</option>
                    </select>

                </div>
            <!--</div>-->
        </div>

    </form>
</div>
<!--添加弹出框-->
<script src="__JS__/jquery.js"></script>
<script>

    /*表单内验证*/
    $(function () {
        $('#addForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            /**
             * 指定提交的按钮，例如：'.submitBtn' '#submitBtn'
             * 当表单验证不通过时，该按钮为disabled
             */
            submitButtons: 'button[type="button"]',
            fields: {
                w_name_add: {
                    message: '菜单名称验证失败',
                    enabled:true,
                    validators: {
                        notEmpty: {
                            message: '菜单名称不能为空'
                        }
                        /*,
                        stringLength: {
                            min: 6,
                            max: 18,
                            message: '用户名长度必须在6到18位之间'
                        },
                        regexp: {
                            regexp: /^[a-zA-Z0-9_]+$/,
                            message: '用户名只能包含大写、小写、数字和下划线'
                        }*/
                    }
                },
                w_control_add: {
                    validators: {
                        notEmpty: {
                            message: '控制器不能为空'
                        }/*,
                        emailAddress: {
                            message: '邮箱地址格式有误'
                        }*/
                    }
                },
                w_way_add:{
                    validators: {
                        notEmpty: {
                            message: '方法不能为空'
                        }/*,
                        emailAddress: {
                            message: '邮箱地址格式有误'
                        }*/
                    }
                }

            }
        });
    });
</script>
